<?php
namespace Shopmanage\Model;
use Think\Model;
class ShopCfgModel extends Model {
	public $curtool;
	public $sid;
	public $taobao_user_id;
	public $usernick;
	public $sessionkey;
	public $refresh_token;
	public function setcur(){
		$data["curtool"]=$this->curtool;
		$re = $this->where("`sid`=".$this->sid)->save($data);
		if($re){
			$data["status"]=true;
			$data["hasError"]=false;
		}else{
			$data["curtool"]=$this->curtool;
			$data["sid"]=$this->sid;
			$data["jointime"]=date("Y-m-d H:i:s");
			$data["logintime"]=date("Y-m-d H:i:s");
			$data["taobao_user_id"]=$this->taobao_user_id;
			$data["usernick"]=$this->usernick;
			$data["sessionkey"]=$this->sessionkey;
			$data["refresh_token"]=$this->refresh_token;
			$re = $this->add($data);
			if($re){
				$data["status"]=true;
				$data["hasError"]=false;
			}else{
				$data["hasError"]=true;
				$data["status"]=false;
				$data["error"]="新增店铺用户失败！";
				$data["sqler"]=$this->getDbError();
				$data["sql"]=$this->_sql();
			}
		}
		return $data;
	}
}